package com.system.common.processor.impl;

import com.system.common.processor.CacheProcessor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.yang.common.core.exception.BaseException;
import org.yang.database.cache.utils.RedisHsahUtils;
import org.yang.database.cache.utils.RedisUtils;

import java.util.concurrent.TimeUnit;

/**
 * 字典
 *
 * @author: lslands
 * @version: 1.0
 * @create: 2024/5/19
 * @description:
 */
@Slf4j
@Component
public class DictProcessor implements CacheProcessor {

    @Autowired
    private RedisHsahUtils redisHsahUtils;

    @Async
    @Override
    public void resetCache() throws BaseException {
        redisHsahUtils.setHashValueWithExpireTime("","","",24L, TimeUnit.HOURS);
        log.info("执行字典新增后的异步任务");
    }

}
